package com.xidian.zhiancloud.controller.myyb;


import com.xidian.zhiancloud.dto.ResultDTO;
import com.xidian.zhiancloud.enums.GeneralResponseEnums;
import com.xidian.zhiancloud.model.SysEnterpriseFoundation;
import com.xidian.zhiancloud.service.myyb.IEnterpriseFoundationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统设置-企业基础信息设置
 */
@RestController
@RequestMapping("/enterpriseFoundation")
public class EnterpriseFoundationController {

    private final static Logger logger = LoggerFactory.
            getLogger(EnterpriseFoundationController.class);

    @Autowired
    private IEnterpriseFoundationService enterpriseFoundationService;


    /**
     * 添加企业认证信息
     * @param enterpriseFoundation 企业认证信息
     * @return ResultDTO对象
     */
    @PostMapping("/add")
    public ResultDTO<Boolean> add(SysEnterpriseFoundation enterpriseFoundation) {
        enterpriseFoundationService.add(enterpriseFoundation);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }

    /**
     * 添加公司证件管理
     * @param enterpriseFoundation 公司证件管理
     * @return ResultDTO对象
     */
    @PatchMapping("/addCertificate")
    public ResultDTO<Boolean> addCertificate(SysEnterpriseFoundation enterpriseFoundation) {
        enterpriseFoundationService.updateByPrimaryKeySelective(enterpriseFoundation);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }

    /**
     * 添加企业基础信息
     * @param enterpriseFoundation 企业基础信息
     * @return ResultDTO对象
     */
    @PatchMapping("/addSecurityRegulatorySetting")
    public ResultDTO<Boolean> addSecurityRegulatorySetting(
            SysEnterpriseFoundation enterpriseFoundation) {
        enterpriseFoundationService.updateByPrimaryKeySecurityRegulatorySetting
                (enterpriseFoundation);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }



}
